<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>坭兴陶制品库存管理系统</title>
    <link rel="stylesheet" type="text/css" href="/easyui/1.5/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="/easyui/1.5/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="/css/public.css">
    <style type="text/css">
        body{font:13px/26px "微软雅黑";background-color:#fff;}

        .form_wrapper {width:720px;background:#F1F1F1;margin:20px auto;padding:10px;}

        form ul {width:720px;list-style-type:none;list-style-position:outside;padding:0px;}
        form li{padding:12px; border-bottom:1px solid #DFDFDF;position:relative;}
        form li:first-child, form li:last-child {border-bottom:1px solid #777;}

        form h2 {margin:0;display: inline;}
        .required_notification {color:#d45252; margin:5px 0 0 0; display:inline;float:right;}

        form label {width:150px;margin-top: 3px;display:inline-block;float:left;padding:3px;font-size:14px;}

        form button {margin-left:156px;}

        .input_file{
            border: 0!important;
            box-shadow: 0px 0px 0px!important;
            padding-right:0px!important;
            -moz-transition: none!important;
            -webkit-transition: none!important;
            -o-transition: none!important;
            transition: none!important;

        }
        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px!important;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
            font-size: 14px;
        }
        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }
        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }

        button.submit {
            background-color: #68b12f;
            background: -webkit-gradient(linear, left top, left bottom, from(#68b12f), to(#50911e));
            background: -webkit-linear-gradient(top, #68b12f, #50911e);
            background: -moz-linear-gradient(top, #68b12f, #50911e);
            background: -ms-linear-gradient(top, #68b12f, #50911e);
            background: -o-linear-gradient(top, #68b12f, #50911e);
            background: linear-gradient(top, #68b12f, #50911e);
            border: 1px solid #509111;
            border-bottom: 1px solid #5b992b;
            border-radius: 3px;
            -webkit-border-radius: 3px;
            -moz-border-radius: 3px;
            -ms-border-radius: 3px;
            -o-border-radius: 3px;
            box-shadow: inset 0 1px 0 0 #9fd574;
            -webkit-box-shadow: 0 1px 0 0 #9fd574 inset ;
            -moz-box-shadow: 0 1px 0 0 #9fd574 inset;
            -ms-box-shadow: 0 1px 0 0 #9fd574 inset;
            -o-box-shadow: 0 1px 0 0 #9fd574 inset;
            color: white;
            font-weight: bold;
            padding: 6px 20px;
            text-align: center;
            text-shadow: 0 -1px 0 #396715;
        }
    </style>
</head>
<body>
    <div class="form_wrapper">
        <form method="post" id="reg_form" enctype="multipart/form-data">
            <ul>
                <li>
                    <h2>用户注册</h2>
                    <span class="required_notification">需填写注册内容</span>
                </li>
                <li>
                    <label for="nickname">姓名:</label>
                    <input id="nickname" name="nickname" class="easyui-textbox" data-options="prompt:'请输入昵称',required:true,width:260,height:35,missingMessage:'请输入昵称'" />
                </li>
                <li>
                    <label for="username">登录名:</label>
                    <input  id="username" name="userName" class="easyui-textbox" data-options="prompt:'请输入用户名',required:true,width:260,height:35,missingMessage:'请输入用户名'"  />

                </li>
                <li>
                    <label for="password">登录密码:</label>
                    <input id="password" name="password" class="easyui-passwordbox" data-options="prompt:'请输入登录密码',required:true,width:260,height:35,missingMessage:'请输入登录密码',validType:'minLength[6]',invalidMessage:'密码长度不能少于6个字符'" />
                </li>
                <li>
                    <label for="reset_password">密码确认:</label>
                    <input id="reset_password" name="reset_password" class="easyui-passwordbox" validType="confirmPass['#password']" data-options="prompt:'请再次输入登录密码',required:true,width:260,height:35,missingMessage:'请输入登录密码',invalidMessage:'两次输入的密码不一致'" />
                </li>
                <li>
                    <label for="mobile">手机号码:</label>
                    <input id="mobile" name="phone" class="easyui-textbox" data-options="prompt:'请输入手机号码',required:true,width:260,height:35,missingMessage:'请输入手机号码',validType:'phoneNum'" />
                </li>

                <li>
                    <label for="email">邮箱:</label>
                    <input id="email" name="email" class="easyui-textbox" data-options="prompt:'请输入邮箱',required:true,width:260,height:35,missingMessage:'请输入邮箱'" />
                </li>
                <li>
                    <button class="submit" type="button" id="submit">提交</button>
                    <#--<button class="submit" type="button" id="resetForm">重置</button>-->
                </li>

            </ul>
        </form>
    </div>
</body>


<script src="/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/layer/layer.js"></script>
<script type="text/javascript" src="/easyui/1.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/easyui/1.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
    document.onkeydown=function(){
        if (event.keyCode == 13){
            $("#submit").click();
        }
    };
        $.extend($.fn.validatebox.defaults.rules, {
            confirmPass: {
                validator: function(value, param){
                    var pass = $(param[0]).passwordbox('getValue');
                    return value == pass;
                },
                message: '两次输入的密码不一致'
            },
            phoneNum:{
                validator:function(value,param){
                    var reg = /^(0|86|17951)?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8}$/g;
                    return reg.test(value);
                },
                message:  '请输入13位数字的有效手机号码！'
            }
        });
//        $(function () {
//            $("#resetForm").click(function () {
//                $('#reg_form')[0].reset()
//            })
//        })

    $("#submit").click(function () {
        var index=com.msg_load();
        $.ajax({
            type: "POST",
            url: "/register/save",
            data:$('#reg_form').serialize(),
            success: function (data) {
                com.msg_load_close(index);
                var d=eval(data);
                if (data!=null&&d.msg=='success') {
                    com.msg_success("注册成功，正在跳转登录界面");
                    setTimeout('location.href="/"', 2000);
                } else {
                    $("#checkCode").click();
                    com.msg_error(d.msg);
                }
            }
        });
    })


    </script>
